UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rZPsKwr6B3QACb3C+Pt4/DDnGqKNgrc7MK4hFXRt8HQ=' 
WHERE 
  key_id = '1737e66c8b600d8926580fbf903670889c98a5e8449b8fe7bc9708869ac4c944' 
  AND (
    token = 'rZPsKwr6B3QACb3C+Pt4/DDnGqKNgrc7MK4hFXRt8HQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035