UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2VzLDuptQ2ImWJTSQZTjiiQmjmXLFZKBytPAfeQV7SI='
WHERE
key_id = '648550294da76b155f3bb5789fe6e24392ee50f88b23d84c2942b45337c469ba'
AND (
token = '2VzLDuptQ2ImWJTSQZTjiiQmjmXLFZKBytPAfeQV7SI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)