UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hdz+kRXa8zdLjYyg+3C265V0PONHsCNJ8p09woAP2zs=' 
WHERE 
  key_id = '969d77f9cf8f427b078504f761b91b240a76c641b9d1aa265e3223dc108fda93' 
  AND (
    token = 'Hdz+kRXa8zdLjYyg+3C265V0PONHsCNJ8p09woAP2zs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037