UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hvtLUiqFav0pAzUQIURIsgxI+KqgytFRFN6mT159j8E=' 
WHERE 
  key_id = '933a3c42d08f5682deeff9317949d8ef672b2804708db6c1763891f93c2ee8ca' 
  AND (
    token = 'hvtLUiqFav0pAzUQIURIsgxI+KqgytFRFN6mT159j8E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026