UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IGSR6w138T3+KYnVG/OZwULdVuxE0MBvciDyF2Y6q40='
WHERE
key_id = '71840656b77deefb7dcace3ba13cbccec8bde5255ec6a64c6cf62e8f320d5e87'
AND (
token = 'IGSR6w138T3+KYnVG/OZwULdVuxE0MBvciDyF2Y6q40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)