UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eQoreJpBT5/MysIfxvDpo+WoPbTctIMByh+jX/ZADxs='
WHERE
key_id = 'af061191968701268783725d907fe42da1a566038e5b13191a5d7b864be7a8bc'
AND (
token = 'eQoreJpBT5/MysIfxvDpo+WoPbTctIMByh+jX/ZADxs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)