UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ioiIexluHg3iz174nGZqybSkwb0pppwST8HmUT3ihfM='
WHERE
key_id = '629be170fc03d371cb438b5f27d9bab191a23704ce2c470b5ae2193acce72d55'
AND (
token = 'ioiIexluHg3iz174nGZqybSkwb0pppwST8HmUT3ihfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)