UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NHSBBwP9fsZdHw3bKhEENaGQXuYPqb6rTxKRquXmTME='
WHERE
key_id = 'e418f93d632769312d071efa42516adb0ced480053aa9a0dad86b3ada0589a0d'
AND (
token = 'NHSBBwP9fsZdHw3bKhEENaGQXuYPqb6rTxKRquXmTME='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)