UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+kLJfnH2a9mPsJKUckohuVOx+mqG7qior8XKv6YkQPw=' 
WHERE 
  key_id = '598b41fcfbbce9868ed36c48d55fb722b1f728bc474c5f6e4a45f9dd9fe1e2c8' 
  AND (
    token = '+kLJfnH2a9mPsJKUckohuVOx+mqG7qior8XKv6YkQPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033