UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u1y9W4CQ5uhKIZmFPfHjWU/fECU99O4vjl1bXIUYutE='
WHERE
key_id = '6e1e26ef4a292b3df92a91ad986fdc369ef95b0a169af57d43f001a62c8669c0'
AND (
token = 'u1y9W4CQ5uhKIZmFPfHjWU/fECU99O4vjl1bXIUYutE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)