UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sr8FuWnerPO0wVOh/yxW/BXBoKI08C5AtBrSeSuR73M='
WHERE
key_id = '34fc49114b0063b4fb32abbd26cf84b5ca7127365ab62270f7cbd38caceb99a9'
AND (
token = 'sr8FuWnerPO0wVOh/yxW/BXBoKI08C5AtBrSeSuR73M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)