UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZxKVFmcKSE1EQVDMeKI1dwitslJHvramSQ2DVdWtBUQ='
WHERE
key_id = '083aecc91a465f9859aa82aa1e7c9894cae986d6645add86bd4f49c501c55b5c'
AND (
token = 'ZxKVFmcKSE1EQVDMeKI1dwitslJHvramSQ2DVdWtBUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)