UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LeoAlyWPyuyDeye+VDhMpQJQXqJgrma4PKWQ7bON3vE='
WHERE
key_id = 'b55937d8ac0d3483e6b7d1269b5fbe1b20c280afc82d15a9f2ef0e7e09ea282c'
AND (
token = 'LeoAlyWPyuyDeye+VDhMpQJQXqJgrma4PKWQ7bON3vE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)