UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3HOMEzpR6SFJ56Jl9hgGfic6wRwI/DbQKmar9zqoZrA='
WHERE
key_id = 'f49d974c415933d9812ec2c3b70b4b96ecf31f14ba8fad4b2ef2cea2157924cf'
AND (
token = '3HOMEzpR6SFJ56Jl9hgGfic6wRwI/DbQKmar9zqoZrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)