UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HxhrQGR5VqVoFBevKbE2dgG1cEKSYg41EVoHRh6gqgw='
WHERE
key_id = '97eadd96f9c68957a462491f9b56e831bcfbb56dcf7f6d58aae775b0dc474a16'
AND (
token = 'HxhrQGR5VqVoFBevKbE2dgG1cEKSYg41EVoHRh6gqgw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)