UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7EILBEvYNbfV1d/EzRXHaR+iZ39ZsJ/AX4PB9+zWG3k='
WHERE
key_id = 'c238a260250ae2f51353b350f3602ab51521382af9541ae1b76b8a3c21fa25d4'
AND (
token = '7EILBEvYNbfV1d/EzRXHaR+iZ39ZsJ/AX4PB9+zWG3k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)