UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P40g1lawmOFaaVXdPJG+k02eVSs/kyUFb5Uke/XOnyc='
WHERE
key_id = '73d11bb3e7e760fee900ccb47c52d5028f0647aa58b4b1de9609930dc4edf42a'
AND (
token = 'P40g1lawmOFaaVXdPJG+k02eVSs/kyUFb5Uke/XOnyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)