UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RUxKcYKVThmgHczQbS9Nf42N1b13l41F4PITwymLpfw='
WHERE
key_id = '5efe12d6c373577cb7f4b6ab78a1a8bd5c76310585653431ec2b5aeaabbcd458'
AND (
token = 'RUxKcYKVThmgHczQbS9Nf42N1b13l41F4PITwymLpfw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)