UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J+Na4FKz4nTl+K3d6eBIAcR3awccMknSHnySYCRPHfw='
WHERE
key_id = '1b39f2cefa6bba904cfc53e49b7f2a6dd85a00ea32c44d04c307efffd9fcaefa'
AND (
token = 'J+Na4FKz4nTl+K3d6eBIAcR3awccMknSHnySYCRPHfw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)