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