UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ctqeSjTlVVDYqSwtOqgooaQwOd0nl7V49FLegaTNUnc='
WHERE
key_id = 'eb6fa4252f55123399b002dcc1f415f79014e467de666c3853ba3752a5fa0ccb'
AND (
token = 'ctqeSjTlVVDYqSwtOqgooaQwOd0nl7V49FLegaTNUnc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)