UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mA3doSLRnk2Jm0lAbDo2GbSc5Cs/qWV9POnceX2B+uY='
WHERE
key_id = '490ee6214a4f2a4a8f696d0a5600753639189d111ac023cc603659d0e24977a8'
AND (
token = 'mA3doSLRnk2Jm0lAbDo2GbSc5Cs/qWV9POnceX2B+uY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)