UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JlXn0ungitLBI/trFmPld5Kuxi+Ssp/wLLpkYvD4kDU='
WHERE
key_id = 'c9a2419367b6f9bf82164343c11779f24af27f3120c10687ae5ba1bd182adbb0'
AND (
token = 'JlXn0ungitLBI/trFmPld5Kuxi+Ssp/wLLpkYvD4kDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)