UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GHv2TNmu2M0NsaWDdKquhiGoN/+Ae0SNF7E41JeFwIA='
WHERE
key_id = '66d0b7a81637f8810f6ff9d351257daa0e30bf5f022f6fe1f28d4616584d693a'
AND (
token = 'GHv2TNmu2M0NsaWDdKquhiGoN/+Ae0SNF7E41JeFwIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)