UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bor+fG026d581cDtezNfxUOEZqvpIt0XUuGlBr7KjbA='
WHERE
key_id = 'a032128d4a7f0aa30e36beff4726e71419cda742d28c83e9141d8111e8bde76d'
AND (
token = 'bor+fG026d581cDtezNfxUOEZqvpIt0XUuGlBr7KjbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)