UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kX++fqIJDtOaGckuxyANJji1A6CrVCqmf8cSLb40Ue0=' 
WHERE 
  key_id = '890343874eeee65ed5f4be7b0bc3d20255dcf2e62589357471875e822ece6879' 
  AND (
    token = 'kX++fqIJDtOaGckuxyANJji1A6CrVCqmf8cSLb40Ue0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039