UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ILccfagQKZK6/2blDKeIDOQHG9/nnFJfgHY04T/06aw='
WHERE
key_id = 'be7961e5c74feb7fcff118eec9a2102e7f1363fc799515552caeb22cb65383d5'
AND (
token = 'ILccfagQKZK6/2blDKeIDOQHG9/nnFJfgHY04T/06aw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)