UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VxwoeckyidIZu0uCCpkLCDr9Kg2S9Uh3tgg7bgZAxWE='
WHERE
key_id = '4765fb8aec9a571650a65e6d9a3b1ad792c8616c20ee21fbebcd2763db2da5f9'
AND (
token = 'VxwoeckyidIZu0uCCpkLCDr9Kg2S9Uh3tgg7bgZAxWE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)