UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hgXazuBT1ajfldz4CO56EDhrmGZKEKllog/rNRICj1k='
WHERE
key_id = '4fa26255da719603bf7dc5b3fec3cf1585faa49729eee88d48cf158b5da63d37'
AND (
token = 'hgXazuBT1ajfldz4CO56EDhrmGZKEKllog/rNRICj1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)