UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H86PBgG1l6ZeWTMA1FCghdnN5/Ja2Dr8D2LYvKCYPR8='
WHERE
key_id = 'f06a8c37303411030fe97cdbc4cb257ae9050366ccb2177bea5ba3830eb67343'
AND (
token = 'H86PBgG1l6ZeWTMA1FCghdnN5/Ja2Dr8D2LYvKCYPR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)