UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Bn8kCTil2pvYYjTkt1pHiY9d0aHU4gEDk4kK/5ePTw=' 
WHERE 
  key_id = '568ea60a930549e723835d1ffe5b4442815dffca69814bd1e00e62d96f275fc0' 
  AND (
    token = '7Bn8kCTil2pvYYjTkt1pHiY9d0aHU4gEDk4kK/5ePTw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035