UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZcW4+t13pYHgCCx8QyRnvRB4W4xkF9PIvn58hE/ZX4g='
WHERE
key_id = '4087ab587447764a4b545838bfb7f46b65a284aed3737ab8fa5cd398a4f08809'
AND (
token = 'ZcW4+t13pYHgCCx8QyRnvRB4W4xkF9PIvn58hE/ZX4g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)