UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j+Vhy2tHTTnq5Pl//8K8XwrAxzvRXV/zR2pCOGkbr5I=' 
WHERE 
  key_id = 'f2327b1538c5bb54ecde045f8520f5a68002222c8c802d86354c56b3d9bf98d5' 
  AND (
    token = 'j+Vhy2tHTTnq5Pl//8K8XwrAxzvRXV/zR2pCOGkbr5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039