UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jvfdWOytIiYzAiVV8stgc7Z7WavvwolgDol/nL66SBo='
WHERE
key_id = 'cc29b58e4413b110aafb0e302522fa74e6379e7e255d376b8ce41df8b5c5a7ca'
AND (
token = 'jvfdWOytIiYzAiVV8stgc7Z7WavvwolgDol/nL66SBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)