UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '92uXl3J4PCGJi73TRW21r1A0SNSJg4Ft/cLvAuv0Af4='
WHERE
key_id = '383237a3b767324605b419846bc9c6a428f570f84f40a899fc032f976098e64b'
AND (
token = '92uXl3J4PCGJi73TRW21r1A0SNSJg4Ft/cLvAuv0Af4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)