UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jfpauSh/E15+sZ+zIx8pSDUokBHgaKYQGaypEzqnJEU=' 
WHERE 
  key_id = '2b99a7d11a4a62742a78fd26153acde504026e9669431c2175d665d7ee92aebc' 
  AND (
    token = 'jfpauSh/E15+sZ+zIx8pSDUokBHgaKYQGaypEzqnJEU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021