UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xrNPHD2hfFQ1jGZKI3Z3In02h/tduKN8G+v54rbWyMM=' 
WHERE 
  key_id = '26c9e0c226e0c4d46a27b10ee2e8739d006bf62d3b5382422967608b96d1e5ca' 
  AND (
    token = 'xrNPHD2hfFQ1jGZKI3Z3In02h/tduKN8G+v54rbWyMM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028