UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c1Jm6MVOStVPNM/x6erUebphH3r/PYxZ+QfuNyhjAds='
WHERE
key_id = 'db1310d6c8e25e9f24acf147dac625db31b13bcc5da87e553eb03590c45b27fe'
AND (
token = 'c1Jm6MVOStVPNM/x6erUebphH3r/PYxZ+QfuNyhjAds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)